import { pubRequire } from '@utils/public'
const baseUrl = '/about-us/video'
const baseUrl2 = '/about-us/article'
//视频列表
export function getVideoList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
//新增视频
export function addVideo(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}
//视频预览
export function videoPreview(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${obj.id}`, {}, callbBack, errBack)
}
//修改状态
export function editStatus(obj, callbBack, errBack) {
  return pubRequire('put', `/about-us/status/${obj.id}`, {}, callbBack, errBack)
}
/* 文章列表 */
export function getArticleList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl2}`, obj, callbBack, errBack)
}
/* 新增文章 */
export function addArticle(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl2}`, obj, callbBack, errBack)
}
/* 文章详情 */
export function articleDetail(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl2}/${obj.id}`, {}, callbBack, errBack)
}
/* 修改文章 */
export function editArticle(id, obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl2}/${id}`, obj, callbBack, errBack)
}
/* 推荐列表 */
export function getRecommendList(obj, callbBack, errBack) {
  return pubRequire('patch', `${baseUrl2}/recommend`, obj, callbBack, errBack)
}
/* 设置序号 */
export function setUpSort(obj, callbBack, errBack) {
  return pubRequire(
    'patch',
    `${baseUrl2}/${obj.id}/recommend/sort/${obj.num}`,
    '',
    callbBack,
    errBack
  )
}
/* 上推荐 */
export function recommend(obj, callbBack, errBack) {
  return pubRequire(
    'patch',
    `${baseUrl2}/${obj.id}/recommend`,
    '',
    callbBack,
    errBack
  )
}
/* 取消推荐 */
export function unRecommend(obj, callbBack, errBack) {
  return pubRequire(
    'patch',
    `${baseUrl2}/${obj.id}/un-recommend`,
    '',
    callbBack,
    errBack
  )
}
